


<!DOCTYPE html>
<html id="htmlId">
<head>
  <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> 
  <title>Coverage Report > YearMonth</title>
  <style type="text/css">
    @import "../../css/coverage.css";
    @import "../../css/idea.min.css";
  </style>
  <script type="text/javascript" src="../../js/highlight.min.js"></script>
  <script type="text/javascript" src="../../js/highlightjs-line-numbers.min.js"></script>
</head>

<body>
<div class="content">
<div class="breadCrumbs">
Current scope:     <a href="../../index.html">all classes</a>
    <span class="separator">|</span>
    <a href="../index.html">&lt;empty package name&gt;</a>
</div>

<h1>Coverage Summary for Class: YearMonth (&lt;empty package name&gt;)</h1>

<table class="coverageStats">
<tr>
  <th class="name">Class</th>
<th class="coverageStat 
">
  Class, %
</th>
<th class="coverageStat 
">
  Method, %
</th>
<th class="coverageStat 
">
  Branch, %
</th>
<th class="coverageStat 
">
  Line, %
</th>
</tr>
<tr>
  <td class="name">YearMonth</td>
<td class="coverageStat">
  <span class="percent">
    100%
  </span>
  <span class="absValue">
    (1/1)
  </span>
</td>
<td class="coverageStat">
  <span class="percent">
    100%
  </span>
  <span class="absValue">
    (7/7)
  </span>
</td>
<td class="coverageStat">
  <span class="percent">
    100%
  </span>
  <span class="absValue">
    (4/4)
  </span>
</td>
<td class="coverageStat">
  <span class="percent">
    100%
  </span>
  <span class="absValue">
    (15/15)
  </span>
</td>
</tr>

</table>

<br/>
<br/>


<pre>
<code class="sourceCode" id="sourceCode">&nbsp;import java.time.LocalDate;
&nbsp;
&nbsp;public class YearMonth {
&nbsp;
&nbsp;    private int year;
&nbsp;    private int month;
&nbsp;
<b class="fc">&nbsp;    public YearMonth(int year, int month) {</b>
<b class="fc">&nbsp;        this.year = year;</b>
<b class="fc">&nbsp;        this.month = month;</b>
&nbsp;    }
&nbsp;
&nbsp;    public YearMonth(String date) {
<b class="fc">&nbsp;        this(Integer.parseInt(date.substring(0, 4)), Integer.parseInt(date.substring(4, 6)));</b>
&nbsp;    }
&nbsp;
&nbsp;    public YearMonth(LocalDate date) {
<b class="fc">&nbsp;        this(date.getYear(), date.getMonthValue());</b>
&nbsp;    }
&nbsp;
&nbsp;    public void previousMonth() {
<b class="fc">&nbsp;        if(month == 1) {</b>
<b class="fc">&nbsp;            year--;</b>
<b class="fc">&nbsp;            month = 12;</b>
&nbsp;        } else {
<b class="fc">&nbsp;            month--;</b>
&nbsp;        }
&nbsp;    }
&nbsp;
&nbsp;    public void nextMonth() {
<b class="fc">&nbsp;        if(month == 12) {</b>
<b class="fc">&nbsp;            year++;</b>
<b class="fc">&nbsp;            month = 1;</b>
&nbsp;        } else {
<b class="fc">&nbsp;            month++;</b>
&nbsp;        }
&nbsp;    }
&nbsp;
&nbsp;    public int getMonth() {
<b class="fc">&nbsp;        return month;</b>
&nbsp;    }
&nbsp;
&nbsp;    public int getYear() {
<b class="fc">&nbsp;        return year;</b>
&nbsp;    }
&nbsp;
&nbsp;}
</code>
</pre>
</div>

<script type="text/javascript">
(function() {
    var msie = false, msie9 = false;
    /*@cc_on
      msie = true;
      @if (@_jscript_version >= 9)
        msie9 = true;
      @end
    @*/

    if (!msie || msie && msie9) {
      hljs.highlightAll()
      hljs.initLineNumbersOnLoad();
    }
})();
</script>

<div class="footer">
    
    <div style="float:right;">generated on 2025-04-26 20:08</div>
</div>
</body>
</html>
